package shootplane;

import java.awt.image.BufferedImage;

/**
 * 飞行物类：x,y,图片、宽、高、速度 子类：英雄机、小敌机、小蜜蜂、子弹、大敌机
 */
public abstract class FlyObject {
    protected int x;
    protected int y;
    protected BufferedImage image;
    protected int speed;
    protected int width;
    protected int height;
    protected int flood;

    public FlyObject() {

    }

    public abstract void move();

    public boolean crashBullet(Bullet a) {
        int x = a.getX();
        int y = a.getY();
        return this.x < x && x < this.x + width && this.y < y && y < this.y + height;
    }

    public BulletEnemy shootHero() {
        return null;
    }

    public int getFlood() {
        return flood;
    }

    public void setFlood(int flood) {
        this.flood = flood;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public BufferedImage getImage() {
        return image;
    }

    public void setImage(BufferedImage image) {
        this.image = image;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

}